// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 4/12/2007 09:13:28
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   RButton.java

package utility;

import java.awt.*;
import java.util.Locale;

// Referenced classes of package de.escape.quincunx.i18n:
//            I18n, Localizable

public class RButton extends Button
    implements Localizable
{

    public RButton(String tag)
    {
        localeUnknown = true;
        setLabel(I18n.getString(tag, getLocale()));
        resTag = tag;
    }

    public void setLocale(Locale l)
    {
        super.setLocale(l);
        super.setLabel(I18n.getString(resTag, l));
        invalidate();
    }

    public Locale getLocale()
    {
        try
        {
            localeUnknown = false;
            return super.getLocale();
        }
        catch(IllegalComponentStateException _ex)
        {
            localeUnknown = true;
        }
        return null;
    }

    public void update(Graphics g)
    {
        if(localeUnknown)
            setLocale(getLocale());
        else
            super.update(g);
    }

    protected boolean localeUnknown;
    protected String resTag;
}